package com.baizhi.bzmall.admin.controller;


import com.baizhi.bzmall.admin.service.IBzAttrGroupService;
import com.baizhi.bzmall.common.vo.ResultEntity;
import com.baizhi.bzmall.entity.BzAttrGroup;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 属性分组; InnoDB free: 11264 kB 前端控制器
 * </p>
 *
 * @author zhengg
 * @since 2021-03-18
 */
@RestController
@RequestMapping("/bzAttrGroup")
public class BzAttrGroupController {
    @Autowired
    private IBzAttrGroupService ibgs;
    @GetMapping("attrGroupCid/{cid}")
    public ResultEntity selectByCid( @PathVariable("cid") int cid){
        QueryWrapper<BzAttrGroup> wrapper=new QueryWrapper<>();
        wrapper.eq("category_id",cid);
        List<BzAttrGroup> list = ibgs.list(wrapper);
        return ResultEntity.ok(list);
    }
}

